﻿using System.Collections.Generic;
using System.Text;

namespace SIToFb2
{
  public class ParsedFicionBook
  {
    public string First { get; set; }
    public string Middle { get; set; }
    public string Last { get; set; }
    public string Title { get; set; }

    public List<Part> Parts { get; set; }

    public ParsedFicionBook()
    {
      Parts = new List<Part>();
    }

  }

  public class Part
  {
    public string Title { get; set; }

    public List<Chapter> Chapters { get; set; }

    public Part()
    {
      Chapters = new List<Chapter>();
    }

    public override string ToString()
    {
      return Title;
    }
  }

  public class Chapter
  {
    public string Title { get; set; }
    public List<string> Lines { get; set; }

    public Chapter(string title)
    {
      Title = title;
      Lines = new List<string>();
      Lines.Add(string.Format("<title>{0}</title>", Title));
    }

    public string GetChapterText()
    {
      var sb = new StringBuilder();
      foreach (var line in Lines)
        sb.AppendLine(line);
      return sb.ToString();
    }


    public override string ToString()
    {
      return Title;
    }
  }
}